//
//  ST_PairsPropBrowserController.swift
//  btvideo
//
//  Created by mac on 2020/10/20.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit

class ST_PairsPropBrowserController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        view.backgroundColor = .clear
        view.addSubview(animateView)
        animateView.snp.makeConstraints { (make) in
            make.left.right.equalToSuperview()
            make.center.equalToSuperview()
            make.height.equalTo(animateView.snp.width).dividedBy(375.0/607.0)
        }
        
        animateView.play { (f) in
            
            self.goback_previous_controller(animated: false) {
                self.play_completion_closure?()
            }
        }
        
    }
    

    var animationIndex = 0
    
    var play_completion_closure:(()->())?
    
    // MARK: - Properties
    fileprivate lazy var animateView:LOTAnimationView = {
        
        let array = ["喜欢火箭","喜欢飞船","喜欢飞机","喜欢跑车"]
        
        let str = array[safe:animationIndex-1] ?? "喜欢火箭"
        
        let path = Bundle.main.path(forResource: str, ofType: "json")!
        
        let control = LOTAnimationView.init(filePath: path)
        
        control.contentMode = UIView.ContentMode.scaleAspectFill
        
//        control.loopAnimation = true
        
        return control
    }()

}
